package com.mysafe.provision.service.tag;

import java.io.Serializable;
import java.util.Set;
import java.util.TreeSet;

import com.mysafe.provision.model.tag.Tag;

public class TagService implements ITagService, Serializable {

	private static final long serialVersionUID = 3649544055561148855L;

	@Override
	public Set<Tag> splitTags(String tags) {
		Set<Tag> tagsSet = new TreeSet<Tag>();
		try {
			String[] tagsArray = tags.split(",");
			for (String t : tagsArray) {
				Tag tag = new Tag(t.trim());
				tagsSet.add(tag);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return tagsSet;
	}
	
}
